package com.bocloud.cmp.dao;

import java.util.List;
import java.util.Map;

import com.bocloud.cmp.entity.ApplyRecord;
import com.bocloud.common.model.Param;
import com.bocloud.database.core.intf.GenericDao;

/**
 * 申请记录DAO接口
 * 
 * @author dongkai
 *
 */
public interface ApplyRecordDao extends GenericDao<ApplyRecord, Long> {

	/**
	 * 分页查询
	 * 
	 * @param page
	 * @param rows
	 * @param params
	 * @param sorter
	 * @return
	 * @throws Exception
	 */
	public List<ApplyRecord> list(int page, int rows, List<Param> params, Map<String, String> sorter) throws Exception;

	/**
	 * 已审批的
	 * 
	 * @param page
	 * @param rows
	 * @param params
	 * @param sorter
	 * @return
	 * @throws Exception
	 */
	public List<ApplyRecord> done(int page, int rows, List<Param> params, Map<String, String> sorter, Long userId)
			throws Exception;

	/**
	 * 获取数量
	 * 
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public int count(List<Param> params) throws Exception;

	/**
	 * 已通过数量
	 * 
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public int countDone(List<Param> params, Long userId) throws Exception;

	/**
	 * 根据ID删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public boolean delete(Long id, Long userId) throws Exception;

	/**
	 * 根据ID查询
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public ApplyRecord query(Long id) throws Exception;
}
